package org.agile2soft.nexoma.core.tapestry.conduit;

import java.lang.annotation.Annotation;

import org.agile2soft.nexoma.core.entity.InternalUser;
import org.agile2soft.nexoma.core.entity.Profile;
import org.apache.tapestry5.PropertyConduit;

public class InternalUserProfilePropertyConduit implements PropertyConduit {

    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
        return null;
    }

    public Object get(Object instance) {
        InternalUser iUser = ( InternalUser ) instance;
        return iUser.getProfile();
    }

    public Class getPropertyType() {
        return Profile.class;
    }

    public void set(Object instance, Object value) {
        InternalUser iUser = (InternalUser) instance;
        iUser.setProfile((Profile)value);
    }

}
